﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using PTA.Auth;

namespace PTA.Entity
{
    /// <summary>
    /// 用户信息的基类
    /// </summary>
    public class UserInfo : BaseEntity, IEntityAuth
    {
        private int userId;
        /// <summary>
        /// 用户编号
        /// </summary>
        public int UserId
        {
            get
            {
                return userId;
            }
            set
            {
                userId = value;
            }
        }

        private int userGuid;
        /// <summary>
        /// 用户编号
        /// </summary>
        public int UserGuid
        {
            get
            {
                return userGuid;
            }
            set
            {
                userGuid = value;
            }
        }

        #region 是否登录
        private bool isLogin = false;
        /// <summary>
        /// 是否登录
        /// </summary>
        public bool IsLogin
        {
            get
            {
                return this.isLogin;
            }
            set
            {
                this.isLogin = value;
            }
        }
        #endregion

        #region 用户登录名
        private string loginName = string.Empty;
        /// <summary>
        /// 用户登录名
        /// </summary>
        public string LoginName
        {
            get
            {
                return this.loginName ?? string.Empty;
            }
            set
            {
                this.loginName = value;
            }
        }
        #endregion

        #region 用户姓名
        private string userName = "匿名用户";
        /// <summary>
        /// 用户姓名
        /// </summary>
        public string UserName
        {
            get
            {
                return this.userName ?? string.Empty;
            }
            set
            {
                this.userName = value;
            }

        }
        #endregion

        #region 用户权限信息
        private List<int> rolelist = new List<int>();
        /// <summary>
        /// 用户角色列表
        /// </summary>
        [Description("实体包含的角色列表")]
        public List<int> RoleList { get { return this.rolelist; } }

        private List<int> inprivilegelist = new List<int>();
        /// <summary>
        /// 实体包含的直接权限（菜单和功能点列表）
        /// </summary>
        [Description("实体包含的权限（菜单和功能点列表）")]
        public List<int> IncludePrivilegeList { get { return this.inprivilegelist; } }

        private List<int> exprivilegelist = new List<int>();
        [Description("实体排除的权限（菜单和功能点列表）")]
        public List<int> ExcludePrivilegeList { get { return exprivilegelist; } }
        #endregion
    }
}
